jQuery — Nested Sortables Plugin — Disabling sortability between parents

Posted by AJB on Stack Overflow See other posts from Stack Overflow or by AJB
Published on 2011-02-03T23:11:07Z Indexed on 2011/02/03 23:26 UTC
Read the original article Hit count: 679

Filed under:
|

I've got a question that I think is simple but I've not been able to figure it out.

This is in regard to this plugin: http://mjsarfatti.com/sandbox/nestedSortable/

Essentially, I want to disable the ability to sort children outside of their parents.

So, I've got this:

CATEGORY 1
      ITEM 1.1
      ITEM 1.2
      ITEM 1.3

CATEGORY 2
      ITEM 2.1
      ITEM 2.2
      ITEM 2.3

So, I'd like to provide the ability for users to sort the children within their category, and the ability to sort the categories themselves. But I want to disable the ability to move a child to another parent. (e.g. ITEM 1.1 cannot be moved to CATEGORY 2). And also I would like to disable the abilty to nest any parents in any children.

I tried setting it so that the 'nestedSortable' function is called for every new OL but that simple disables sorting for everything entirely.

Thanks for any help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about sortables